package com.zc.operator.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.zc.operator.domain.ChargeMchInfo;
import com.zc.operator.mapper.ChargeMchInfoMapper;
import com.zc.operator.service.IChargeMchInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 商户Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-16
 */
@Service
public class ChargeMchInfoServiceImpl implements IChargeMchInfoService
{
    @Autowired
    private ChargeMchInfoMapper chargeMchInfoMapper;

    /**
     * 查询商户
     *
     * @param id 商户主键
     * @return 商户
     */
    @Override
    public ChargeMchInfo selectChargeMchInfoById(Long id)
    {
        return chargeMchInfoMapper.selectChargeMchInfoById(id);
    }

    /**
     * 查询商户列表
     *
     * @param chargeMchInfo 商户
     * @return 商户
     */
    @Override
    public List<ChargeMchInfo> selectChargeMchInfoList(ChargeMchInfo chargeMchInfo)
    {
        return chargeMchInfoMapper.selectChargeMchInfoList(chargeMchInfo);
    }

    /**
     * 新增商户
     *
     * @param chargeMchInfo 商户
     * @return 结果
     */
    @Override
    public int insertChargeMchInfo(ChargeMchInfo chargeMchInfo)
    {
        chargeMchInfo.setCreateTime(DateUtils.getNowDate());
        return chargeMchInfoMapper.insertChargeMchInfo(chargeMchInfo);
    }

    /**
     * 修改商户
     *
     * @param chargeMchInfo 商户
     * @return 结果
     */
    @Override
    public int updateChargeMchInfo(ChargeMchInfo chargeMchInfo)
    {
        return chargeMchInfoMapper.updateChargeMchInfo(chargeMchInfo);
    }

    /**
     * 批量删除商户
     *
     * @param ids 需要删除的商户主键
     * @return 结果
     */
    @Override
    public int deleteChargeMchInfoByIds(Long[] ids)
    {
        return chargeMchInfoMapper.deleteChargeMchInfoByIds(ids);
    }

    /**
     * 删除商户信息
     *
     * @param id 商户主键
     * @return 结果
     */
    @Override
    public int deleteChargeMchInfoById(Long id)
    {
        return chargeMchInfoMapper.deleteChargeMchInfoById(id);
    }
}
